package v2;
import java.awt.Dimension;



public class ParticleCircle extends ParticleShape {
	
	private Dimension center;
	private double radius;
	private double density;

	public ParticleCircle(Dimension center, double radius, double density){
		this.center = center;
		this.radius = radius;
		this.density=  density;
		generateParticles();
	}
	public ParticleCircle(double x, double y, double radius, double density){
		this.center = new Dimension((int)x,(int)y);
		this.radius = radius;
		this.density=  density;
		generateParticles();
	}
	
	private void generateParticles(){
		double centerX = center.getWidth();
		double centerY = center.getHeight();
		
		for(double t=0; t < Math.PI/2; t+=2*Math.PI/density){
			double x = radius*Math.cos(t);
			double y = radius*Math.sin(t);
			add(new StaticParticle(centerX + x, centerY + y));
			add(new StaticParticle(centerX + x, centerY - y));
			add(new StaticParticle(centerX - x, centerY + y));
			add(new StaticParticle(centerX - x, centerY - y));
		}
	}
}
